package merchant.service;

import java.util.Map;

import merchant.dao.Merchant;
import merchant.dao.MerchantDAO;

import com.google.gson.Gson;

import hackathon1212.ServletPojoAdapter;

public class CreateMerchant extends ServletPojoAdapter{
	private static final long serialVersionUID = 4605944594066611332L;

	protected String getBusinessMethod(Map<String, String[]> params){		
		final String json = params.get("merchant")[0];
		try{
			MerchantDAO.get().saveMerchant(new Gson().fromJson(json, Merchant.class));
		} catch (Exception e){
			System.out.println(json);
		}
		return "success";
	}
	
}
